Similar to gtk_widget_should_layout(), add a
gtk_accessible_should_present() function that backends can
use to determine whether an accessible should be presented
or not.
Ways to make a widget not presented in a11y:
- hide the widget
- set its role to NONE
- make it have a NULL AT context
We will use this in future to hide the GtkText inside
an entry, since the Text implementation will be done
by the wrapper.
#include "gtkatcontextprivate.h"
#include "gtkenums.h"
#include "gtktypebuiltins.h"
+#include "gtkwidget.h"
#include <glib/gi18n-lib.h>
gtk_at_context_update (context);
}
+gboolean
+gtk_accessible_should_present (GtkAccessible *self)
+{
+ if (GTK_IS_WIDGET (self) &&
+ !gtk_widget_get_visible (GTK_WIDGET (self)))
+ return FALSE;
+
+ if (gtk_accessible_get_accessible_role (self) == GTK_ACCESSIBLE_ROLE_NONE)
+ return FALSE;
+
+ return TRUE;
+}
void gtk_accessible_platform_changed (GtkAccessible *self,
GtkAccessiblePlatformChange change);
+gboolean gtk_accessible_should_present (GtkAccessible *self);
+
G_END_DECLS